<template>
  <ul class="fixed-nav">
    <li>
      <div class="item">
        <i class="icon icon-phone"></i>
        <p class="icon-text">电话咨询</p>
      </div>
      <div class="item-box">
        <p class="box-phone">{{configs.mobile_phone}}</p>
      </div>
    </li>
    <li>
      <div class="item">
        <i class="icon icon-weixin"></i>
        <p class="icon-text">微信咨询</p>
      </div>
      <div class="item-box">
        <img class="box-qrcode" :src="configs.consult_qrcode_2" alt="微信咨询">
      </div>
    </li>
    <li>
      <div class="item" @click="goTop()">
        <i class="icon icon-top"></i>
        <p class="icon-text">返回顶部</p>
      </div>
    </li>
  </ul>
</template>

<script>
export default {
  props: ['configs'],
  methods: {
    // 回到顶部
    goTop() {
      let clearTop = setInterval(function() {
        document.documentElement.scrollTop -= 100
        if (document.documentElement.scrollTop < 1) {
          clearInterval(clearTop)
        }
      }, 15)
    }
  }
}
</script>